package constant

import (
	"inventory/pkg/ecode"
)

// SystemError
var (
	ErrSystemError = ecode.ErrSystemError
)

// InvalidArgument
var (
	ErrMisMatchFreezeOrder  = ecode.BadRequest("冻结单明细与履约单不匹配")
	ErrAddressMissing       = ecode.BadRequest("缺少收货地址信息")
	ErrExceedOrderLimit     = ecode.BadRequest("最多同时创建100个订单")
	ErrDuplicateStorageKeys = ecode.BadRequest("明细中不允许出现重复的仓储关键字")
	ErrInvalidExpressFee    = ecode.BadRequest("配送费计算错误")
	ErrInvalidPackages      = ecode.BadRequest("包裹拆分错误")
	ErrCalculationNotExist  = ecode.BadRequest("找不到配送费计算请求")
	ErrCalculationMismatch  = ecode.BadRequest("计费请求与履约请求内容不匹配")
	ErrCalculationReused    = ecode.BadRequest("计费请求幂等关键字重复且状态不合法")
	ErrInvalidOrderKeyType  = ecode.BadRequest("订单号关键字不符合int格式")
)

// BizError
var (
	ErrWarehouseNotExist       = ecode.BizError("OBJECT_NOT_EXIST", "仓库不存在")
	ErrOrderNotExist           = ecode.BizError("OBJECT_NOT_EXIST", "单据不存在")
	ErrObjectNotExist          = ecode.BizError("OBJECT_NOT_EXIST", "商品库对象不存在")
	ErrMaterialTypeNotExist    = ecode.BizError("OBJECT_NOT_EXIST", "物料类型不存在")
	ErrInvalidMaterialType     = ecode.BizError("OBJECT_NOT_EXIST", "物料类型非法")
	ErrMaterialNotExist        = ecode.BizError("OBJECT_NOT_EXIST", "物料不存在")
	ErrExpressPlatformNotExist = ecode.BizError("OBJECT_NOT_EXIST", "配送平台不存在")
	ErrPermissionError         = ecode.BizError("PERMISSION_ERROR", "权限不足")
	ErrNoMatchWarehouse        = ecode.BizError("WAREHOUSE_NOT_MATCH", "当前收货地址没有能够自提/配送的仓库")
	ErrProcessStatus           = ecode.BizError("INVALID_PROCESS_ORDER_STATUS", "履约单状态不合法")
	ErrInvalidFreezeOrder      = ecode.BizError("FREEZE_ORDER_INVALID", "冻结单非法")
	ErrDuplicateInput          = ecode.BizError("DUPLICATE_INPUT", "同名数据已存在")
	ErrForbiddenAction         = ecode.BizError("FORBIDDEN_ACTION", "操作禁止")
	ErrMaximumNumber           = ecode.BizError("MAXIMUM_NUMBER", "数值超过可存储最大范围")
	ErrStorageUnavailable      = ecode.BizError("STORAGE_UNAVAILABLE", "库存不足")
	ErrOrderRefunding          = ecode.BizError("ORDER_REFUNDING", "当前履约单有未处理的退款申请，请先处理再进行其他操作")
	ErrRemoteAPIFailed         = ecode.BizError("REMOTE_API_FAILED", "")
	// 以下三个错误，由于仓库属性可能在下单前后改变，因此
	ErrInvalidExpressMode = ecode.BizError("INVALID_EXPRESS_MODE", "仓库不支持当前配送模式")
	ErrInvalidRegion      = ecode.BizError("INVALID_REGION", "不在所选仓库同城配送区域范围")
	ErrInvalidCity        = ecode.BizError("INVALID_CITY", "不在所选仓库普通快递配置可送达城市范围")
	ErrNeedRefresh        = ecode.BizError("NEED_REFRESH", "当前页面信息过旧，请刷新页面再试")
)

// Unauthenticated
var ErrUnauthenticated = ecode.Unauthenticated("登录已失效，请重新登录")
